package com.domor.system.service;

import com.domor.common.core.text.Convert;
import com.domor.system.domain.SysLoginLog;
import com.domor.system.mapper.SysLoginLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <h3>系统访问日志 服务层</h3>
 * @author liyuyang
 * @date 2020/5/7
 **/
@Service
public class SysLoginLogService {

    @Autowired
    private SysLoginLogMapper loginLogMapper;

    /**
     * 查询系统登录日志集合
     *
     * @param logininfor 访问日志对象
     * @return 登录记录集合
     */
    public List<SysLoginLog> selectLoginLogList(SysLoginLog logininfor) {
        return loginLogMapper.selectLoginLogList(logininfor);
    }

    /**
     * 新增系统登录日志
     *
     * @param logininfor 访问日志对象
     */
    public void insertLoginLog(SysLoginLog logininfor) {
        loginLogMapper.insertLoginLog(logininfor);
    }

    /**
     * 批量删除系统登录日志
     *
     * @param ids 需要删除的数据
     * @return
     */
    public int deleteLoginLogByIds(String ids) {
        return loginLogMapper.deleteLoginLogByIds(Convert.toStrArray(ids));
    }

    /**
     * 清空系统登录日志
     */
    public void cleanLoginLog() {
        loginLogMapper.cleanLoginLog();
    }

}
